package server;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;



public class ServerGui extends JFrame{
	

	private JButton b;
    private JTextField jtf;
    private JTextArea textArea;
    private JPanel  container;
    private JScrollPane scrollPane;
  
	
	
	
	 public ServerGui(){
		  
		 container = new JPanel();	    
	     //b = new JButton ("send");
	     jtf= new JTextField("");
	     textArea = new JTextArea();
	     scrollPane = new JScrollPane(textArea);
	    	     
	     
	     
	     this.setTitle("SERVER");
		 this.setSize(600, 600);	    	   
		 //this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		 container.setLayout(null);			  
		 //container.setLayout(new GridLayout(0,1));
		  
		 
		  textArea.setEditable(false);
		  scrollPane.setBounds(10, 50, 400, 430);
		 
		  jtf.setBounds(10,500 ,480 ,30 );
		  
		  jtf.addKeyListener(new KeyAction());
		  
		  //jtf.addKeyListener(new KeyAction());
		  
		  //b.addActionListener(new Action());
		  //b.setBounds(500, 500, 70, 30);
	 

		  //container.add(label1);		  		  
		  //container.add(jtf);
		  //container.add(b);
		  container.add(scrollPane);
		  
		 

		  this.setContentPane(container); 
	      this.setVisible(true);
	  }


   
		public  void ActualiserTextArea(String newLine) {
			
			newLine=newLine+" \n";
			textArea.append(newLine);
			
		
		}

	public JButton getB() {
		return b;
	}

	public void setB(JButton b) {
		this.b = b;
	}




	public JTextField getJtf() {
		return jtf;
	}


	public void setJtf(JTextField jtf) {
		this.jtf = jtf;
	}
	
	
	
	

}
